home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / commodity_viewer_actor.c4 < prev    next >
Text File  |  2003-01-17  |  2KB  |  71 lines

  1. {
  2.     @loaded {
  3.       ResByName("gui/laptop/map_button/big_blue_dot.pcx");
  4.       ResByName("gui/laptop/map_button/red_dot.pcx");
  5.     }
  6.     @draw {
  7.       DrawTextStr(
  8.         ResByName("font/verdana_9_black.tf"),
  9.         ResPropGetInt(SELF, "ScreenX") + ResPropGetInt(SELF,"city_text_x"),
  10.         ResPropGetInt(SELF, "ScreenY") + ResPropGetInt(SELF,"city_text_y"),
  11.         "%s",
  12.         ResPropGetStr(SELF, "city_name")
  13.       );
  14.     }
  15.     @updateCommodity {
  16.       resid commodity_drawer_id;
  17.       resid font_id;
  18.       str   cur_commodity;
  19.       str   com1;
  20.       str   com2;
  21.       str   com3;
  22.       int   selected;
  23.       int   x;
  24.       int   y;
  25.       resid player_id;
  26.       
  27.       player_id = ResPropGetResID(ResByName("Game"), "game_cur_player");
  28.  
  29.       ResPropSetInt(SELF, "Hidden", TRUE);
  30.  
  31.       commodity_drawer_id = ResByName("country_map.gl/commodity_drawer");
  32.       cur_commodity       = ResPropGetStr(commodity_drawer_id, "cur_commodity");
  33.       com1                = ResPropGetStr(SELF, "com1");
  34.       com2                = ResPropGetStr(SELF, "com2");
  35.       com3                = ResPropGetStr(SELF, "com3");
  36.       selected            = 0;
  37.  
  38.       if (StrExact(cur_commodity, "")) {
  39.         selected = 0;
  40.       } else if (StrExact(com1, cur_commodity)) {
  41.         selected = 1;
  42.       } else if (StrExact(com2, cur_commodity)) {
  43.         selected = 1;
  44.       } else if (StrExact(com3, cur_commodity)) {
  45.         selected = 1;
  46.       }
  47.  
  48.       if (selected) {
  49.         ResPropSetResID( SELF, "AnimationID", ResByName("gui/laptop/map_button/red_dot.pcx"));
  50.         ResPropSetInt( SELF, "Hidden", FALSE );
  51.         stop;
  52.       }
  53.  
  54.       if (player_id == ResByName("Player1")) {
  55.         if (ResPropGetInt(SELF, "is_player1_dest")) {
  56.           ResPropSetResID(SELF, "AnimationID", ResByName("gui/laptop/map_button/big_blue_dot.pcx"));
  57.           ResPropSetInt(SELF, "Hidden", FALSE);
  58.           stop;
  59.         }
  60.       }
  61.       if (player_id == ResByName("Player2")) {
  62.         if (ResPropGetInt(SELF, "is_player2_dest")) {
  63.           ResPropSetResID(SELF, "AnimationID", ResByName("gui/laptop/map_button/big_blue_dot.pcx"));
  64.           ResPropSetInt(SELF, "Hidden", FALSE);
  65.           stop;
  66.          }
  67.       }
  68.  
  69.     }
  70. }
  71.